package com.wjc.train.business.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.wjc.train.business.req.DailyTrainTicketQueryReq;
import com.wjc.train.business.resp.DailyTrainTicketQueryResp;
import com.wjc.train.business.service.IDailyTrainTicketService;
import com.wjc.train.common.resp.CommonResp;
import com.wjc.train.common.untils.PageUtil;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 余票信息 前端控制器
 * </p>
 *
 * @author Guessed
 * @since 2023-08-14
 */
@RestController
@Validated
@RequestMapping("/daily-train-ticket")
public class WebDailyTrainTicketController {

    @Resource
    private IDailyTrainTicketService dailytrainticketService;



    @PostMapping("/query-list")
    public CommonResp save(@RequestBody DailyTrainTicketQueryReq dailytrainticketQueryReq){
        IPage<DailyTrainTicketQueryResp> iPage =
        dailytrainticketService.queryList(PageUtil.getPage(dailytrainticketQueryReq.getQueryPage()), dailytrainticketQueryReq);
        return CommonResp.success(new PageUtil(iPage));
    }

}


